﻿<Window x:Class="WishfulCode.EC2RDP.View.Accounts"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Accounts" Height="600" Width="423">
    <DockPanel  DataContext="{Binding Source={StaticResource Locator}, Path=AccountSettings}">
        <TextBlock DockPanel.Dock="Top" Margin="5" VerticalAlignment="Top" Height="70"   TextWrapping="Wrap" Text="Specify your account details here. Note that this account only needs permission to describe instances and access cloud-watch metric data. It is recommended to use the IAM service on AWS to create a new set of credentials. This is because this information will be saved locally." />
        <GroupBox DockPanel.Dock="Top" VerticalAlignment="Stretch"  Margin="5" Header="AWS Account">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="80"></ColumnDefinition>
                    <ColumnDefinition></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition></RowDefinition>
                    <RowDefinition></RowDefinition>
                    <RowDefinition></RowDefinition>
                    <RowDefinition Height="200"></RowDefinition>
                </Grid.RowDefinitions>

                <TextBlock Grid.Column="0" Grid.Row="0" Margin="10" Text="Access Key" />
                <TextBox Grid.Column="1" Grid.Row="0" Margin="10" Text="{Binding AWSAccessKey}"></TextBox>

                <TextBlock Grid.Column="0" Grid.Row="1" Margin="10" Text="Secret Key" />
                <TextBox Grid.Column="1" Grid.Row="1" Margin="10" Text="{Binding AWSSecretKey}"></TextBox>
                
                <TextBlock Grid.Column="0" Grid.Row="2" Margin="10" Text="Default Instance Username" />
                <TextBox Grid.Column="1" Grid.Row="2" Margin="10" Text="{Binding DefaultRemoteUsername}"></TextBox>

                <StackPanel Grid.Row="3" Grid.ColumnSpan="2" Orientation="Vertical">
                    <DataGrid AutoGenerateColumns="False" ItemsSource="{Binding GridData}">
                        <DataGrid.Columns>
                            <DataGridTextColumn Header="KeyName" Binding="{Binding Path=Key}" Width="Auto" />
                            <DataGridTextColumn Header="Content" Binding="{Binding Path=Value}" Width="Auto">
                                <DataGridTextColumn.ElementStyle>
                                    <Style TargetType="TextBlock">
                                        <Setter Property="TextWrapping" Value="Wrap" />
                                    </Style>
                                </DataGridTextColumn.ElementStyle>
                                <DataGridTextColumn.EditingElementStyle>
                                    <Style TargetType="TextBox">
                                        <Setter Property="TextWrapping" Value="Wrap" />
                                        <Setter Property="AcceptsReturn" Value="true" />
                                    </Style>
                                </DataGridTextColumn.EditingElementStyle>
                            </DataGridTextColumn>
                            
                        </DataGrid.Columns>
                        
                    </DataGrid>
                </StackPanel>

            </Grid>
        </GroupBox>
        <StackPanel HorizontalAlignment="Right" VerticalAlignment="Bottom" DockPanel.Dock="Bottom" Orientation="Horizontal">
            <Button Content="Close" Margin="10" Width="60" Click="Button_Click"></Button>
        </StackPanel>
    </DockPanel>
</Window>
